<template>
    <div>
        <!-- 面包屑导航 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>用户反馈</el-breadcrumb-item>
        </el-breadcrumb>

        <div style="margin-top:15px"></div>
        <el-alert
            title="收集用户反馈，请快速处理，优化用户体验"
            type="success"
            effect="dark">
        </el-alert>
        <div style="margin-top:15px"></div>
            <!--列表-->
    <el-table size="small" :data="listData" highlight-current-row v-loading="loading"  element-loading-text="拼命加载中" style="width: 100%;">
            
            <el-table-column
              prop="email"
              label="邮箱">
            </el-table-column>
            
            

          <el-table-column
              prop="message"
              label="消息">
          </el-table-column>



            <el-table-column
              prop="createTime"
              label="时间">
          </el-table-column>

          <el-table-column
              prop="state"
              label="是否处理">
               <template slot-scope="scope">
                      <el-tag :type="scope.row.state == '0'?'danger':'success'" size="medium">{{ scope.row.state =='0'?'未处理':'处理完成'}}</el-tag>
              </template>
          </el-table-column>
          
         

         

            

           <el-table-column
            label="操作"
            >
            <template slot-scope="scope">
                <el-popconfirm
                    title="问题解决了吗？"
                    @confirm="deleteClick(scope.row.id)"
                    >
                <el-button  slot="reference" v-if="scope.row.state == 0 "  type="danger" size="small"><i class="el-icon-s-cooperation"/>处理</el-button>
                </el-popconfirm>
            </template>
        </el-table-column>
    </el-table>

    </div>
</template>
<script>
export default {
    data() {
        return {
            loading:false,
            listData:[]
        }
    },
    created(){
        this.getList();
    },
    methods:{
        getList(){ //获取数据

            this.loading =true

            this.$api.get("/feedback/findFeedbackAdmin","",Response=>{
                 this.listData=Response.data.data;
            })

             setTimeout(()=>{
                this.loading =false
            },500)
        },
        deleteClick(id){
            this.$api.get("/feedback/updateFeedbackAdmin/"+id,"",Response=>{
                this.getList();
            })
        }
    }
}
</script>
<style scoped>
    
</style>